Micron Document
🌎 rns.kin.earth git 🌍

Node / dev / reticulum / commits / 903ab53

Commit 903ab53fc9a5f3ef8f64ded5e4bd9a003fdb272a


Parents : f461a78
Author : Mark Qvist <mark@unsigned.io>
Date : 2024-10-05T17:04:39+02:00

Fixed init fail due to missing library on Android/Termux

Changes

1 files changed, 13 insertions(+), 2 deletions(-)


Diff

diff --git a/RNS/Interfaces/Android/RNodeInterface.py b/RNS/Interfaces/Android/RNodeInterface.py
index 36e9e475..293f9e0d 100644
--- a/RNS/Interfaces/Android/RNodeInterface.py
+++ b/RNS/Interfaces/Android/RNodeInterface.py
@@ -28,8 +28,14 @@ import time
import math
import RNS
-from able import BluetoothDispatcher, GATT_SUCCESS
-from able.adapter import require_bluetooth_enabled
+try:
+ from able import BluetoothDispatcher, GATT_SUCCESS
+except Exception as e:
+ GATT_SUCCESS = 0x00
+ class BluetoothDispatcher():
+ def __init__(**kwargs):
+ RNS.log("Attempt to initialise BLE connectivity, but Android BLE support library is unavailable", RNS.LOG_ERROR)
+ raise OSError("No BLE support available")
class KISS():
FEND = 0xC0
@@ -81,6 +87,8 @@ class KISS():
ERROR_INITRADIO = 0x01
ERROR_TXFAILED = 0x02
ERROR_EEPROM_LOCKED = 0x03
+ ERROR_QUEUE_FULL = 0x04
+ ERROR_MEMORY_LOW = 0x05
ERROR_INVALID_FIRMWARE = 0x10
ERROR_INVALID_BLE_MTU = 0x20
@@ -1242,6 +1250,9 @@ class RNodeInterface(Interface):
elif (byte == KISS.ERROR_TXFAILED):
RNS.log(str(self)+" hardware TX error (code "+RNS.hexrep(byte)+")", RNS.LOG_ERROR)
raise IOError("Hardware transmit failure")
+ elif (byte == KISS.ERROR_MEMORY_LOW):
+ RNS.log(str(self)+" hardware error (code "+RNS.hexrep(byte)+"): Memory exhausted", RNS.LOG_ERROR)
+ self.hw_errors.append({"error": KISS.ERROR_MEMORY_LOW, "description": "Memory exhausted on connected device"})
else:
RNS.log(str(self)+" hardware error (code "+RNS.hexrep(byte)+")", RNS.LOG_ERROR)
raise IOError("Unknown hardware failure")

Served by rngit 1.5.2 - Generated in 0.04s